#!/bin/bash

set -e

export PATH="$PATH:/state/rust/cargo/bin"
export BUILD_ROOT=/state/build
export RELEASE=2
ln -sf out/node_modules .

echo "--- Install n2"
./tools/install-n2

echo "+++ Building"
if [ $(uname -m) = "aarch64" ]; then
    export PYTHONPATH=/usr/lib/python3/dist-packages
    ./ninja wheels:anki
else
    ./ninja bundle
fi
